import { get, post, put, del } from '@/utils/http/request'
import { R, P } from '@/utils/http/type'

/**
 *
 * @returns
 */
export const adminLogin = (data: {
  username: string
  password: string
}): R<{
  accessToken: string
  refreshToken: string
}> => {
  return post('/user/login', data)
}

export const refreshToken = (
  token: string
): R<{
  accessToken: string
  refreshToken: string
}> => {
  return get('/user/refresh', { token })
}

export const testApi = () => {
  return post<R<any>>('/user', {
    username: '1806839210',
    password: '123456',
    avatar: '1',
    nickname: 'cv法师',
  })
}
